package com.hs.android.fortress.intro;

import com.hs.android.fortress.GameApplication;
import com.hs.android.fortress.ingame.GameScreenActivity;
import com.hs.android.fortress.model.Player;

import android.app.Activity;
import android.content.Intent;

public class IntroIntentFactory {
	
	Activity mIntroActivity;
	
	public IntroIntentFactory(Activity introActivity){
		mIntroActivity = introActivity;
	}
	
	public Intent create(Player user){
		Intent intent = null;
		
		if(user.getState() == Player.NORMAL_STATE){
			intent = new Intent(mIntroActivity, MenuActivity.class);
		}else if(user.getState() == Player.WAIT_ROOM_STATE){
			intent = new Intent(mIntroActivity, WaitingRoomActivitiy.class);		
			intent.putExtra(WaitingRoomFragment.EXTRA_ROOM_NUMBER, user.getRoomId());
		}else if(user.getState() == Player.PLAY_GAME_STATE){
			intent = new Intent(mIntroActivity, GameScreenActivity.class);
			intent.putExtra(GameScreenActivity.EXTRA_ROOM_NUMBER, user.getRoomId());
		}
		
		return intent;
	}
}
